#coding:utf-8
"""
*   Coder    : Dzlua
*   Email    : 505544956@qq.com
*   Time     : 2017/09/28
"""
#--------------------#
from flask import Flask, request

#--------------------#
from controllers import init_controllers
from models import init_models
from apis import init_apis

#--------------------#
def create_app(object_name):
    """Create the app instance via `Factory Method`"""
    app = Flask(__name__)
    # Set the app config
    app.config.from_object(object_name)

    # init SQLALCHEMY
    init_models(app)

    # Register the Blueprint into app object
    init_controllers(app)

    # init apis
    init_apis(app)

    return app
#----------#

#--------------------#
    